package com.ming.mobliesafe.uitls;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

public class StreamTool {

	public static String readFormInputStream(InputStream inputStream)
			throws IOException {
		ByteArrayOutputStream bot = new ByteArrayOutputStream();
		byte[] buffer = new byte[1024];
		int length = 0;
		while ((length = inputStream.read(buffer)) != -1) {
			bot.write(buffer, 0, length);
		}
		String result = bot.toString();
		bot.close();
		return result;
	}

}
